package com.ttbj.withdraw.dao;


import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.ttbj.api.dto.Page;
import com.ttbj.withdraw.bean.po.WdPassword;
import com.ttbj.withdraw.bean.po.Withdraw;


public interface WithdrawMapper {
	
	/**
	 * 通过账户号，同时查询企业和司机表，来查询其对应的加密提现密码
	 * @param accountNo 账户号
	 * @return WdPassword 对象信息
	 */
	public WdPassword queryWdPasswordByAccount(String accountNo);
	
	/**
	 * 增加提现信息
	 * @param withdraw 提现信息对象
	 * @return
	 */
	public int insertWithdrawInfo(Withdraw withdraw);
	
	/**
	 * 通过提现异步通知返回的ORDERNO（提现订单号（外部系统））更新status（提现状态）
	 * @param withdraw 提现对象
	 * @return
	 */
	public int updateStatusAndRetInfoByOrderNo(Withdraw withdraw);
	
	/**
	 * 通过提现订单号orderNo（分账系统订单号）更新提现状态和提现描述 
	 * @param status 状态值
	 * @param retInfo 提现描述
	 * @param orderNo 提现订单号（分账系统订单号）
	 * @return
	 */
	public int updateStatusAndInfo(@Param("status") String status, @Param("retInfo") String retInfo, @Param("orderNo") String orderNo);
	
	/**
	 * 分页和查询条件查询提现信息
	 * @param withdraw 提现信息
	 * @return
	 */
	public List<Withdraw> queryWithdrawResultInfoByPage(@Param("w") Withdraw withdraw, @Param("page") Page page);
	
	/**
	 * 分页和查询条件查询提现信息的数量
	 * @param withdraw 提现信息
	 * @return
	 */
	public Integer queryWithdrawResultInfoByPageCount(Withdraw withdraw);
	
	/**
	 * 分页和查询条件查询提现日志 
	 * @param withdraw 提现信息
	 * @param page 分页页码
	 * @return
	 */
	public List<Withdraw> queryWithdrawLogByPage(@Param("w") Withdraw withdraw, @Param("page") Page page);
	
	/**
	 * 分页和查询条件查询提现日志数量
	 * @param withdraw 分页页码
	 * @return
	 */
	public Integer queryWithdrawLogByPageCount(Withdraw withdraw);
}
